package com.example.tutorialmongodb.syncdata.model;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.sql.Timestamp;

/**
 * @author: cph
 * @date: 2021/10/26 17:38
 */
@Data
@Document(collection = "user_login_promotion_channel")
@CompoundIndex(
        name = "uq_user_id_with_tuiguang_id",
        def = "{'userId': 1, 'tuiguangId: 1'}",
        unique = true)
public class UserLoginPromotionChannelEntity {
    @Id
    private String id;
    /**
     * 用户id
     */
    @Field("user_id")
    private String userId;

    /**
     * 推广id
     */
    @Field("tuiguang_id")
    private String tuiguangId;

    /**
     * 完整的推广id
     */
    @Field("generalize_id")
    private String generalizeId;

    /**
     * 落地页链接
     */
    @Field("url")
    private String url;

    /**
     * 更新时间
     */
    @Field("update_time")
    private Timestamp updateTime;
}
